package cz.cernilovsky.android.profileapp.services;

import cz.cernilovsky.android.profileapp.activities.MainActivity;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

public class ServiceLoaderBroadcastReceiver extends BroadcastReceiver {

	@Override
	public void onReceive(Context context, Intent intent) {
		if(context.getSharedPreferences(MainActivity.MAIN_PREFERENCES, Context.MODE_PRIVATE).getBoolean(MainActivity.STARTUP_PREFERENCE, true)) {
			Intent i = new Intent(context, MonitorGeofencesService.class);
			context.startService(i);
			i = new Intent(context, LoadGeofencesService.class);
			context.startService(i);
		}
	}

}
